<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\Db;
class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
        return $this->view->fetch();
    }
    public function banner(){
    	$banner = Db::name('banner')->select();
    	if($banner){
            $arr = [
               'state'     => 1,
               'banner'  =>$banner,
               'message'   => "请求成功！"
            ];
        }else{
            $arr = [
               'state'     => 0,
               'message'  => "失败！"
            ];
        }
        return json($arr);  
    }
}
